$.ajaxPrefilter(function(option){
    console.log(option.url);
    option.url = 'http://api-breakingnews-web.itheima.net' + option.url
    if(option.url.includes('/my/')){
        option.headers = {
            Authorization : localStorage.token || ''
        }
        option.complete = function(e){
            console.log(e);
            if(e.responseJSON.status ===1 && e.responseJSON.message ==='身份认证失败！') {
                // 清除本地存储
                localStorage.removeItem('token')
                // 跳转登录页面
                location.href ='/login.html'
        }
    }
}
})